<?php
require_once('configure.php');
ini_set("display_errors",1); 
if( (int)$_GET['q'] >0 ){
	$query = "SELECT * FROM  jabatan a
		INNER JOIN sk_jabatan b ON b.sk_id=a.sk_id
		WHERE b.active='Y' 
		AND a.nomor_posisi LIKE '{$_GET['q']}%'  
	";
	$res = my_query($query);
	while( $rw=my_fetch_array($res) ){
		echo strtoupper($rw['nomor_posisi']."/".$rw['nama_jabatan'])."\n";
	}
}else{
	$query = "SELECT * FROM  jabatan a
		INNER JOIN sk_jabatan b ON b.sk_id=a.sk_id
		WHERE b.active='Y' 
		AND a.nama_jabatan LIKE '{$_GET['q']}%'  
	";
	$res = my_query($query);
	while( $rw=my_fetch_array($res) ){
		echo strtoupper($rw['nama_jabatan']."/".$rw['nomor_posisi'])."\n";
	}
}
/*
list($nomor,$nama) = explode("/" ,$_GET['q'] );
$query = "SELECT * FROM  jabatan 
	WHERE nomor_posisi LIKE '{$nomor}%'  
	OR nama_jabatan LIKE '{$nama}%')
";
 */
exit;
?>